<!DOCTYPE html>
<html>
<head>
    <title>已选车位明细</title>
<#include "../../common/common.ftl"/>
</head>
<body>
<div class="layui-tab layui-tab-brief" id="selected">
    <ul class="layui-tab-title">
        <li type="0">已选选房号明细</li>
        <li type="1">已选房源明细</li>
        <li type="2">已选储物间明细</li>
        <li class="layui-this" type="3">已选车位明细</li>
        <li type="4">已回迁情况</li>
        <li type="5">全部房源信息查看</li>


    </ul>
    <div class="layui-fluid" id="list">
        <div class="layui-row layui-col-space10">
            <div class="layui-col-xs12">
                <div class="layui-card">
                    <div class="layui-card">
                        <div class="layui-card-body">
                            <form class="layui-form" id="searchForm">
                                县市：
                                <div class="layui-inline" style="width: 120px;">
                                    <select name="search_eq_string_zsp.town" id="townSelect">
                                        <option value="">--请选择--</option>
                                    </select>
                                </div>
                                <div class="layui-inline layui-hide-xs">征收项目名称：</div>
                                <div class="layui-inline layui-hide-xs">
                                    <select name="search_eq_integer_zsp.id" id="zsProjectSelect">
                                        <option value="">--请选择--</option>
                                    </select>
                                </div>
                                安置项目名称：
                                <div class="layui-inline" style="width: 120px;">
                                    <input class="layui-input" name="search_like_string_azp.projectName"
                                           autocomplete="off">
                                </div>
                                协议编号：
                                <div class="layui-inline" style="width: 120px;">
                                    <input class="layui-input" name="search_like_string_c.contractCode"
                                           autocomplete="off">
                                </div>
                                安置签约状态：
                                <div class="layui-inline" style="width: 120px;">
                                    <select name="search_eq_integer_c.azSignStatus" id="azSignStatusSelect">
                                        <option value="">--请选择--</option>
                                    </select>
                                </div>
                                车位类型：
                                <div class="layui-inline" style="width: 120px;">
                                    <select name="search_eq_integer_cl.carLotType" id="carLotTypeSelect">
                                        <option value="">--请选择--</option>
                                    </select>
                                </div>
                                选房时间：
                                <div class="layui-inline" style="width: 120px;">
                                    <input type="text" class="layui-input" id="startDate"
                                           name="search_ge_date_cl.chooseHouseDate">
                                </div>
                                <button class="layui-btn" type="button" id="searchButton"><i
                                        class="layui-icon layui-icon-search"></i>搜索
                                </button>
                            </form>
                            <table id="dataTable" class="layui-table" lay-filter="layFilter"></table>
                            <!--序号-->
                            <script type="text/html" id="indexTpl">
                                {{d.LAY_TABLE_INDEX+1}}
                            </script>
                            <!--菜单-->
                            <!-- 表格头部工具栏 -->
                            <script type="text/html" id="toolbar">
                                <div class="layui-btn-container right">
                                    <button lay-event="reload" class="layui-btn layui-btn-sm"><i
                                            class="layui-icon layui-icon-refresh"></i>重载
                                    </button>
                                    <button lay-event="exportButton" class="layui-btn layui-btn-sm"><i
                                            class="layui-icon layui-icon-layim-download"></i>已选车位数据导出
                                    </button>

                                </div>
                            </script>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
<script src="/layui/layui.js" charset="utf-8"></script>
<script>
    layui.config({
        base: '/modules/' //静态资源所在路径
    }).use(['table', 'form', 'jquery', 'jmdf', 'page', 'laydate', 'element', 'dataDict'], function () {
        var $ = layui.jquery, jmdf = layui.jmdf, page = layui.page, table = layui.table, form = layui.form, laydate = layui.laydate, element = layui.element, dataDict = layui.dataDict;

        form.render();
        dataDict.select("签约状态", "azSignStatusSelect", "");
        dataDict.select("车位类型", "carLotTypeSelect", "");
        dataDict.zsProject("zsProjectSelect", "");
        dataDict.select("乡镇", "townSelect", "");


        laydate.render({
            elem: '#startDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        laydate.render({
            elem: '#stopDate'
            , type: 'date'
            , format: 'yyyy-MM-dd'
        });
        /***********************table表格相关操作 start*************************/
        var tableRenderId = "renderId";
        var tableId = "dataTable";
        var table_layFilter = "layFilter";
        var tableUrl = "loadSelectedCarLotList";

        //列项内容
        var cols = [[
            {title: "序号", toolbar: '#indexTpl', type: "numbers", fixed: 'left', align: 'center', width: 60}
            , {field: "zsProjectName", title: "征收项目", align: 'center', minWidth: 250}
            , {field: "contractCode", title: "协议编号", align: 'center', minWidth: 160}
            , {field: "name", title: "被动迁人", align: 'center', minWidth: 160}
            , {
                field: "azSignStatus", title: "安置签约状态", align: 'center', minWidth: 150, templet: function (d) {
                    return d.azSignStatusStr;
                }
            }
            , {field: "azProjectName", title: "安置小区", align: 'center', width: 200}
            , {field: "houseNum", title: "户号", align: 'center', width: 160}
            , {field: "carLotTypeStr", title: "车位类型", align: 'center', width: 100}
            , {field: "buildArea", title: "建筑面积", align: 'center', minWidth: 160}
            , {field: "chooseHouseDate", title: "选房时间", align: 'center', minWidth: 160}

        ]];
        //table设置项
        var options = {
            elem: '#' + tableId//table列表id值
            , url: tableUrl
            , toolbar: '#toolbar'//自定义工具栏
            , cols: cols
            , id: tableRenderId
            , defaultToolbar: ['filter', 'print']//显示列、打印
            , autoSort: false //禁用前端自动排序。
        };

        //初始表格（含分页设置）
        page.render(options);
        //表格排序
        page.sort(tableId, tableRenderId);
        //刷新当前页方法封装
        page.reload();

        //分页查询（查询条件）
        $("#searchButton").click(function () {
            page.search("searchForm", tableRenderId);
        });

        $("#selected li").click(function () {
            var type = $(this).attr("type");
            if (type == 0) {
                location.href = 'selectedContractList'
            } else if (type == 1) {
                location.href = 'selectedHouseList'
            } else if (type == 2) {
                location.href = 'selectedStorageRoomList'
            } else if (type == 3) {
                location.href = 'selectedCarLotList'
            } else if (type == 4) {
                location.href = 'selectedContractListByDate'
            } else if (type == 5) {
                location.href = 'selectedAllHouseList'
            }
        });

        //头工具栏事件
        table.on('toolbar(' + table_layFilter + ')', function (obj) {
            switch (obj.event) {
                case 'reload':
                    loadData();
                    break;
                case 'exportButton':
                    location.href = 'selectedCarLotListExcel?' + $("#searchForm").serialize();
                    break;
            }
        });

    });
</script>
</body>
</html>